package com.hifar.test.api.config;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

/**
 * API配置类
 * 用于配置数据资产管理平台接口相关参数
 */
@Configuration
@ConfigurationProperties(prefix = "api.data-platform")
public class ApiConfig {
    
    /**
     * 接口基础URL
     */
    private String baseUrl;
    
    /**
     * 默认用户名
     */
    private String defaultUsername;
    
    /**
     * 默认密码
     */
    private String defaultPassword;
    
    /**
     * RSA公钥
     */
    private String rsaPublicKey;
    
    /**
     * 连接超时时间（毫秒）
     */
    private Integer connectTimeout = 30000;
    
    /**
     * 读取超时时间（毫秒）
     */
    private Integer readTimeout = 60000;
    
    /**
     * 是否启用日志记录
     */
    private Boolean enableLogging = true;
    
    /**
     * 日志级别
     */
    private String logLevel = "INFO";
    
    // Getters and Setters
    public String getBaseUrl() {
        return baseUrl;
    }
    
    public void setBaseUrl(String baseUrl) {
        this.baseUrl = baseUrl;
    }
    
    public String getDefaultUsername() {
        return defaultUsername;
    }
    
    public void setDefaultUsername(String defaultUsername) {
        this.defaultUsername = defaultUsername;
    }
    
    public String getDefaultPassword() {
        return defaultPassword;
    }
    
    public void setDefaultPassword(String defaultPassword) {
        this.defaultPassword = defaultPassword;
    }
    
    public String getRsaPublicKey() {
        return rsaPublicKey;
    }
    
    public void setRsaPublicKey(String rsaPublicKey) {
        this.rsaPublicKey = rsaPublicKey;
    }
    
    public Integer getConnectTimeout() {
        return connectTimeout;
    }
    
    public void setConnectTimeout(Integer connectTimeout) {
        this.connectTimeout = connectTimeout;
    }
    
    public Integer getReadTimeout() {
        return readTimeout;
    }
    
    public void setReadTimeout(Integer readTimeout) {
        this.readTimeout = readTimeout;
    }
    
    public Boolean getEnableLogging() {
        return enableLogging;
    }
    
    public void setEnableLogging(Boolean enableLogging) {
        this.enableLogging = enableLogging;
    }
    
    public String getLogLevel() {
        return logLevel;
    }
    
    public void setLogLevel(String logLevel) {
        this.logLevel = logLevel;
    }
    
    @Override
    public String toString() {
        return "ApiConfig{" +
                "baseUrl='" + baseUrl + '\'' +
                ", defaultUsername='" + defaultUsername + '\'' +
                ", defaultPassword='[PROTECTED]'" +
                ", rsaPublicKey='" + rsaPublicKey + '\'' +
                ", connectTimeout=" + connectTimeout +
                ", readTimeout=" + readTimeout +
                ", enableLogging=" + enableLogging +
                ", logLevel='" + logLevel + '\'' +
                '}';
    }
}
